package cn.yshujia.domain.entity;

import cn.yshujia.handler.PrefixHandler;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author YShuJia
 * @since 2024/4/23
 */
@Data
@TableName (value = "t_resources", autoResultMap = true)
@Schema (name = "Resources", description = "")
public class Resources implements Serializable {
	
	@Serial
	private static final long serialVersionUID = 1L;
	
	@TableId (value = "id", type = IdType.AUTO)
	private Long id;
	
	@Schema (description = "标签ID")
	@TableField ("label_id")
	private Long labelId;
	
	@Schema (description = "资源文件名")
	@TableField ("`name`")
	private String name;
	
	@Schema (description = "链接")
	@TableField (value = "url", typeHandler = PrefixHandler.class)
	private String url;
	
	@Schema (description = "大小")
	@TableField (value = "size")
	private Double size;
	
	@Schema (description = "描述")
	@TableField ("remark")
	private String remark;
	
	@Schema (description = "创建时间")
	@TableField (value = "create_time", fill = FieldFill.INSERT)
	private Date createTime;
	
	@Schema (description = "是否启用")
	@TableField ("status")
	private Boolean status;
}
